Coffee School Environment and Obstacles

Creating the Environment and the Obstacles

This section looks at creating the environment for the game, making the player interact with it and programmatically creating the obstacles the player must pass through.

  1. Introduction - Outlining how we will go about working through this section.
  2. Creating the Ground - Drawing the ground, using variables to determine its dimensions.
  3. Making Moving Obstacles - Briefly discusses the strategy to how you will generate obstacles
  4. Creating the Obstacle Generation Function - Here you'll create your obstacle generating function and create some variables in it to use when making the obstacles
  5. Generating Obstacle Entities - In this section you'll finish off your obstacle generation function by generating a pair of entities using the variables created earlier
  6. Creating Obstacles at set Intervals - Adding a counter and using it to create obstacles at a fixed rate
  7. Moving the Obstacles! - Here you will add code to the game loop to move obstacles across the screen and destroy them if they go off the screen
  8. Detecting Collisions With the Player - We briefly discuss how we're going to detect collisions and use it to make the game properly playable
  9. Adding Collision Component and Checking for Hits - Adding the collision component to the player and checking for hits with the ground and obstacles. The game will freeze if a hit happens.